<!DOCTYPE html>
<html lang="zh">
<html xmlns:th="http://www.thymeleaf.org">
<head th:replace="common/header :: header(~{::title},~{::link},~{})">

    <title>用户列表</title>
    <link rel="icon" th:href="@{/assets/img/lcxm.ico}" type="image/ico">
    <link rel="stylesheet" th:href="@{/assets/css/common.css}">
</head>
<body class="body">
<!--导航-->
<div th:replace="common/nav :: nav(true)"></div>
<div class="container">
    <!--<div class="page-header" style="margin-top: 20px;top:50%;">
        <h1 class="text-primary">凯捷科技 <small>简易点餐</small></h1>
    </div>-->
    <div class="row row-nocol">


        <form class="form-inline lookup" role="form" method="post">


            <div class="form-group" style="margin-left: 5px">
                <label class="control-label sr-only" for="lookup-userCode">工号</label>
                <div class="input-group">
                    <input class="form-control input-sm" id="lookup-userCode" name="userCode" type="text"
                           th:value="${pager.lookup?.userCode}" placeholder="工号">
                </div>
            </div>
            <div class="form-group" style="margin-left: 5px">
                <label class="control-label sr-only" for="lookup-userName">用户名</label>
                <div class="input-group">
                    <input class="form-control input-sm" id="lookup-userName" name="userName" type="text"
                           th:value="${pager.lookup?.userName}" placeholder="用户名">
                </div>
            </div>

            <div class="form-group" style="margin-left: 5px">
                <label class="control-label sr-only" for="lookup-type">类型</label>
                <div class="input-group">
                    <select style="width: 100%" class="form-control input-sm" id="lookup-type" name="type"
                            th:attr="data-value=${pager.lookup?.type}">
                        <option value="">--请选择类型--</option>
                        <option th:each="item:${types}" th:value="${item.name()}" th:text="${item.text}"></option>
                    </select>
                </div>
            </div>

            <div class="form-group" style="margin-left: 5px">
                <label class="control-label sr-only" for="lookup-devManager">是否开发经理</label>
                <div class="input-group">
                    <select style="width: 100%" class="form-control input-sm" id="lookup-devManager" name="devManager"
                            th:attr="data-value=${pager.lookup?.devManager}">
                        <option value="">--是否开发经理--</option>
                        <option value="false">--否--</option>
                        <option value="true">--是--</option>
                    </select>
                </div>
            </div>

            <div class="form-group" style="margin-left: 5px">
                <label class="control-label sr-only" for="lookup-enable">状态</label>
                <div class="input-group">
                    <select style="width: 100%" class="form-control input-sm" id="lookup-enable" name="enable"
                            th:attr="data-value=${pager.lookup?.enable}">
                        <option value="">--状态--</option>
                        <option value="true">--启用--</option>
                        <option value="false">--禁用--</option>
                    </select>
                </div>
            </div>

            <div class="form-group" style="margin-left: 5px">
                <label class="control-label sr-only" for="lookup-groupId">小组</label>
                <div class="input-group">
                    <select class="form-control input-sm" id="lookup-groupId" name="groupId"
                            th:attr="data-value=${pager.lookup?.groupId}" data-url="group/all">
                        <option value="">--请选择小组--</option>
                    </select>
                </div>
            </div>

            <div class="form-group pull-right">
                <button type="submit" class="btn btn-primary btn-sm">
                    <i class="glyphicon glyphicon-search"></i> 查询
                </button>
                <button type="button" class="btn btn-info btn-sm reset">
                    <i class="glyphicon glyphicon-refresh"></i> 重置
                </button>
            </div>

        </form>
        <hr/>
        <!-- 操作信息提示的地方 -->
        <div th:if="${remind}" class="alert alert-${ remind.level  }"
             th:classappend="'alert-' + ${remind.level}">
            <button data-dismiss="alert" class="close" type="button">
                <i class="glyphicon glyphicon-remove"></i>
            </button>
            <span th:remove="tag" th:utext="${ remind.message }"></span>
        </div>
        <!--列表栏-->
        <form class="nocol">

            <div class="action-bar">

            </div>

            <table class="table table-striped  table-hover table-bordered stable">
                <thead>
                <tr class="text-center">
                    <th>工号</th>
                    <th>用户名</th>
                    <th>类型</th>
                    <th>状态</th>
                    <th>是否开发经理</th>
                    <th>所属小组</th>
                    <th class="text-info">操作</th>
                </tr>
                </thead>
                <tbody align="center">
                <tr th:each="cur:${pager?.datas}">
                    <td th:text="${cur.userCode}" class="text-info">userCode</td>
                    <td th:text="${cur.userName}">userName</td>
                    <td th:text="${cur.type?.getText()}">type</td>
                    <td >
                        <span th:text="${cur.enable?'启用':'禁用'}" th:attr="data-random-label=${cur.enable? '1' : '2'}" >group</span>
                    </td>
                    <td th:text="${cur.devManager?'是':'否'}">type</td>
                    <td th:text="${cur.groupName}">usedTime</td>
                    <td>
                        <div class="btn-group-dis">
                            <button th:if="${cur.couldEdit}" class="btn btn-xs btn-info action-get" type="button"
                                    th:attr="data-url='/user/edit/'+${cur.id}"
                                    data-toggle="tooltip"
                                    title="编辑" data-confirm="确定需要编辑当前用户吗?">
                                <i class="glyphicon glyphicon-edit"></i>
                            </button>

                            <button th:if="${cur.isEnable()}" class="btn btn-xs btn-danger action-get" type="button"
                                    th:attr="data-url='/user/disable/'+${cur.id}"
                                    data-toggle="tooltip"
                                    title="禁用" data-confirm="确定禁用当前用户吗？对于禁用的用户，将影响其部分功能，如无法参与实时统计">
                                <i class="glyphicon glyphicon-eye-close"></i>
                            </button>
                            <button th:if="${!cur.isEnable()}" class="btn btn-xs btn-primary action-get" type="button"
                                    th:attr="data-url='/user/enable/'+${cur.id}"
                                    data-toggle="tooltip"
                                    title="启用" data-confirm="确定启用当前用户吗？">
                                <i class="glyphicon glyphicon-eye-open"></i>
                            </button>
                        </div>
                    </td>
                </tr>
                <!-- </c:forEach> -->
                </tbody>
            </table>

        </form>
        <!--页码相关-->
        <div th:replace="common/pager :: pager"></div>
    </div>


</div>

<!-- 引入通用js-->
<div th:replace="common/footer :: footer"></div>
<script>
    function clickContent(e) {
        $.alert({
            theme: 'bootstrap',
            title: '工作内容',
            content: e.title
        });
    }

    function clickDate(id) {
        $.alert({
            theme: 'bootstrap',
            title: '当日工作详情',
            columnClass: 'col-md-10 col-md-offset-1',
            content: "url:" + (ctx + "report/day/" + id)
        });
    }

</script>
</body>
</html>